<?php
require_once 'pages/TMSFrontUserPage.inc';
require_once 'util/TCart.inc';

class TMSFrontCartPage extends TMSFrontUserPage {
	public function Positions(){
		return $this->Cart->Positions();
	}
	
	public function http_Delete($product){
		$this->Cart->DeletePosition($product);
	}
	
	public function http_Save($cart){
		foreach ($cart as $product=>$quantaty)
			$this->Cart->SetQuantaty($product, $quantaty);
	}
	
	public function http_Clear(){
		$this->Cart->MakeEmpty();
	}
	
	public function DeleteUrl($product){
		return $this->Url(null,'Delete',array('product'=>$product));
	}
	
	public function TotalSum(){
		return $this->Cart->TotalSum();
	}
}
